<%@page language="java" pageEncoding="UTF-8"%>
<%@include file="/views/common/include/taglib.jsp"%>
<link type="text/css" rel="stylesheet"
	href="${ctx }/css/dlifestyle/sectionparent.css" source="widget" />
<link type="text/css" rel="stylesheet"
	href="${ctx }/css/dlifestyle/admin.css" source="widget" />
<script
	src="${ctx}/js/controllers/news/cellmanual/CellManualEditController.js"
	type="text/javascript"></script>
<!-- 图文混排器的预览 -->
<script src="${ctx}/js/common/preview.js" type="text/javascript"></script>
<style>
select {
	padding-left: 18px;
	font-size: 14px;
	border-radius: 10px;
	width: 83%;
	margin-top: 4px;
	background-image: none;
	border: 1px solid #E5E5E5;
	color: #8b8787;
}
</style>
<section>
	<div style="height: 40px; line-height: 40px;">
		<div class="forword_area"></div>
		<div class="location">当前位置：${sessionScope.currcent_position}</div>
	</div>
	<hr>
	<div class="panel panel-default">
		<div class="editTitle">
			<div style="height: 41px; width: 190px; float: left;">
				<img style="float: left; margin-left: 37px; margin-top: 9.5px;"
					src="${ctx}/images/new_edit.png" />
				<c:if test="${type == 1 }">
					<h4>新增社区政务</h4>
				</c:if>
				<c:if test="${type == 2 }">
					<h4>编辑社区政务</h4>
				</c:if>
			</div>
			<div>
				<a style="float: right; margin-right: 20px; margin-top: -2px;"
					title="关闭" onclick="cancel();"><img
					src="${ctx}/images/new_close.png" /></a>
			</div>
		</div>
		<div id="form" class="form" style="min-height: 350px;">
			<div class="itemEditMap" style="height: 100px">
				<input id="noticeId" type="hidden" value="${cellManual.id }">
				<input id="noticecellId" type="hidden" value="${cellManual.cellId }">
				<input id="imageLogo" type="hidden" value="${cellManual.logo }">
				<span class="col-sm-1 editlableEditMap"
					style="height: 100px; line-height: 100px;">封面图片：</span>
				<div class="flEditMap" style="height: 100px;">

					<c:if test="${cellManual.logo == null || cellManual.logo == ''}">
						<img id="preview3"
							style="width: 70px; height: 70px; float: left; margin-top: 10px;"
							title="快上传封面图片吧" src="${ctx}/images/cellManual-default.png" />
					</c:if>
					<c:if test="${cellManual.logo != null && cellManual.logo != ''}">
						<img id="preview3"
							style="width: 70px; height: 70px; float: left; margin-top: 10px;"
							src="${sessionScope.image_logo}${cellManual.logo}" />
					</c:if>
					<div class="mtjxsa" style="float: left; margin: 25px 20px;">
						<p style="text-align: left; font-size: 12px;" id="imageBtn">
							<input type="hidden" name="imageLogoUrl" id="imageLogoUrl"
								value="${cellManual.logo}" /> <label class="lbl"
								style="width: 400px; height: 15px;">提示：只能上传.jpg,
								.png的图片格式,照片文件大小最大为10MB</label>

						</p>
						<div>
							<div class="fl">
								<button
									style="width: 100px; height: 25px; margin-top: 5px; background-color: #593505; color: #fff; border: 0px; line-height: 25px;"
									class="acblu tctpsc">上传封面图片</button>
							</div>
						</div>
					</div>
					<%@include file="/views/common/uploader/picture.jsp"%>
				</div>
			</div>
			<div class="itemEdit">
				<input id="manualcellId" type="hidden" value="${cellManual.cellId }">
				<label class="col-sm-1 editlableEdit">小区名：</label>
				<div class="flEdit">
					<c:if test="${type == 1 }">
						<select id="cellid" class="controlEdit" onblur="checkCellName()"
							style="height: 29px; width: 150px;" required>
							<option value="">--小区--</option>
							<option value="${sessionScope.user_login.currentCell.id}">${sessionScope.user_login.currentCell.cellName}</option>
						</select>
						<em class="emStyle">*</em>
					</c:if>
					<c:if test="${type == 2 }">
						<select id="cellid" class="controlEdit" onblur="checkCellName()"
							style="height: 29px; width: 150px;" required>
							<option value="${cellManual.cellId}"
								<c:if test="${item.id == manualcellId}">selected="selected"</c:if>>${cellManual.cellName}</option>
						</select>
					</c:if>
				</div>
			</div>
			<div class="itemEdit">
				<label class="col-sm-1 editlableEdit">标题：</label>
				<div class="flEdit">
					<input id="cellmanualId" type="hidden" value="${cellManual.id}">
					<input class="controlEdit" style="width:80%" id="title" onblur="checkTitle()"
						type="text" value="${cellManual.title}" class="text"
						style="padding-left: 12px;" maxlength="50"
						placeholder="请输入标题（最多50字）" /> <em class="emStyle">*</em>
				</div>
			</div>
			<div class="itemEdit">
				<span class="col-sm-1 editlableEdit">副标题：</span>
				<div class="flEdit">
					<input class="controlEdit" style="width:80%;padding-left: 12px;" id="subtitle"
						type="text" maxlength="50" placeholder="请输入副标题（最多50字）" value="${cellManual.subTitle}">
				</div>
			</div>
			<div class="itemEdit">
				<span class="col-sm-1 editlableEdit">关键字：</span>
				<div class="flEdit">
					<input class="controlEdit" style="width:80%;padding-left: 12px;" id="keyword"
						type="text" maxlength="50" placeholder="请输入关键字（最多50字）" value="${cellManual.keyWord}">
				</div>
			</div>
			<div class="itemEdit">
				<span class="col-sm-1 editlableEdit">排序：</span>
				<div class="flEdit">
					<input class="sortEdit" id="sort" onblur="checkSort()"
						type="number" maxlength="11"
						value="${cellManual.sort == null ? 1 : cellManual.sort}">
					<em class="emStyle">*</em>
				</div>
			</div>
			<div class="editorDetail" style="background: #fdfdfd;">
				<img style="margin-left: -80px; margin-top: -5px;"
					src="${ctx}/images/content.png" /> <span
					class="col-sm-1 editlableEdit" style="border-right: 0">内容：</span> <img
					style="float: right; margin: 12px 20px;" title="内容预览"
					src="${ctx}/images/preview.png" onclick="contentPreview('${ctx}')">
			</div>
			<div style="height: auto; min-height: 261px;">
				<div id="ueditor">

					<!-- 加载编辑器的容器 -->
					<script id="container" type="text/plain">${cellManual.content }</script>
					<!-- 配置文件 -->
					<script type="text/javascript"
						src="${ctx }/js/lib/ueditor/ueditor.config.js"></script>
					<!-- 编辑器源码文件 -->
					<script type="text/javascript"
						src="${ctx }/js/lib/ueditor/ueditor.all.js"></script>
					<script type="text/javascript"
						src="${ctx }/js/lib/ueditor/ueditor.parse.js"></script>
					<!-- 实例化编辑器 -->
					<script type="text/javascript">
						var ue = UE.getEditor('container',{
							toolbars : [
								       	  ['fontfamily','fontsize', '|', 'blockquote', 'horizontal', '|', 'removeformat', '|', 'insertimage'],
								       	  ['bold', 'italic', 'underline', 'forecolor', 'backcolor', '|',
								       	   'justifyleft', 'justifycenter', 'justifyright', '|',
								       	   'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
								       	   'insertorderedlist', 'insertunorderedlist', '|',
								       	   'imagenone', 'imageleft', 'imageright', 'imagecenter','autotypeset','cleardoc','source'
								       	   ]
								       	],
							UEDITOR_HOME_URL: '${ctx}/js/lib/ueditor/',
							serverUrl: '${ctx}/fileHandler/upLoaderMergeForUeditor',
							imageUrlPrefix: '${sessionScope.image_logo}',
							imageActionName: 'uploadimage',
							imageFieldName: 'file',
							imageMaxSize: 1024000,
							imageAllowFiles: ['.png', '.jpg', '.jpeg', '.gif'],
							initialFrameHeight: 200,
							elementPathEnabled: false,
							retainOnlyLabelPasted:true,
							wordCount: false,
							/* sourceEditor: 'textarea', */
							insertorderedlist: {
								// 系统自带
								'decimal': '',     // '1,2,3...'
								'lower-alpha': '', // 'a,b,c...'
								'lower-roman': '', // 'i,ii,iii...'
								'upper-alpha': '', // 'A,B,C'
								'upper-roman': ''  // 'I,II,III...'
							},
							insertunorderedlist : {
								// 系统自带
								'circle': '',  // '○ 小圆圈'
								'disc': '',    // '● 小圆点'
								'square': ''   // '■ 小方块'
							},
							listDefaultPaddingLeft: '50'
						});
							</script>
				</div>
			</div>
			<div class="foot">
				<button class="buttonCancle" onclick="cancel();">取&nbsp;&nbsp;消</button>
				<button class="buttonEdit" onclick="saveCellManual();">保&nbsp;&nbsp;存</button>
			</div>
		</div>
		<%@include file="/views/common/footer.jsp"%>
	</div>
</section>
<script type="text/javascript">
	var ctx = '${ctx}';
	setCtx(ctx);
	//动态获取图文混排编辑器的宽度
	/*   $(function(){
			var width=document.getElementById("form").offsetWidth;
	        $("#container").css("width",(width-250));
	    }); */
</script>
<!-- 解决ie 6 7 8 9不能显示placeholder的问题 -->
<script src="${ctx}/js/lib/jquery.JPlaceholder.js"></script>